﻿@model IEnumerable<JSonTest.Customers>

@{
		ViewBag.Title = "Home Page";
		Layout = "~/Views/Shared/_Layout.cshtml";
}



<!-- Customers template -->
<div ng-show="customersVisible">

		<div style="margin-bottom: 70px; margin-top: 20px;">

				<div class="dropdown pull-right">
						<button class="btn btn-primary dropdown-toggle" data-toggle="dropdown" style="margin-right: 10px"><span class="glyphicon glyphicon-floppy-disk">&nbsp;</span>Export&nbsp;&nbsp;<span class="caret"></span></button>
						<ul class="dropdown-menu">
								<li><a href="">Excel (.xls)</a></li>
								<li><a href="">Word (.doc)</a></li>
								<li><a href="">CSV (.csv)</a></li>
						</ul>
						<button class="btn btn-primary pull-right" onclick="javascript: print();"><span class="glyphicon glyphicon-print"></span>&nbsp;Print</button>
				</div>
		</div>


		<h2>Customers</h2>
		<hr />

		<a href="@Url.Action("Create", "CustomersEF")" class="btn btn-primary" style="margin-bottom: 20px"><span class="glyphicon glyphicon-user">&nbsp;</span>Create New</a>


		<div class="panel panel-primary">
				<div class="panel-heading">List of customers</div>
				<div class="panel-body">
						<div ng-controller="FetchCustomersController">
								<table class="table table-bordered table-hover table-responsive">
										<tr>
												<th>Firstname</th>
												<th>Lastname</th>
												<th>Telephone</th>
												<th>Birthdate</th>
												<th>Telephone</th>
												<th>City</th>
										</tr>
										<tr ng-repeat="c in customers">
												<td>{{c.Firstname}}</td>
												<td>{{c.Lastname}}</td>
												<td>{{c.Telephone}}</td>
												<td>{{c.Birthdate}}</td>
												<td>{{c.Telephone}}</td>
												<td>{{c.City}}</td>
												<td>
														<a href="@Url.Action("Details", "OrdersEF")/{{c.Customer_ID}}" class="btn btn-warning"><span class="glyphicon glyphicon-th-list">&nbsp;</span>Orders</a> |
														<a href="@Url.Action("Edit", "CustomersEF")/{{c.Customer_ID}}" class="btn btn-info"><span class="glyphicon glyphicon-edit">&nbsp;</span>Edit</a> |
														<a href="@Url.Action("Details", "CustomersEF")/{{c.Customer_ID}}" class="btn btn-primary"><span class="glyphicon glyphicon-tags">&nbsp;</span>Details</a> |
														<a href="@Url.Action("Delete", "CustomersEF")/{{c.Customer_ID}}" class="btn btn-danger"><span class="glyphicon glyphicon-trash">&nbsp;</span>Delete</a>
												</td>
										</tr>
								</table>
						</div>
				</div>
		</div>
</div>
<!-- *****************  -->
<!-- Items Template -->
<div ng-show="itemsVisible">

		<div style="margin-bottom: 70px; margin-top: 20px;">

				<div class="dropdown pull-right">
						<button class="btn btn-primary dropdown-toggle" data-toggle="dropdown" style="margin-right: 10px"><span class="glyphicon glyphicon-floppy-disk">&nbsp;</span>Export&nbsp;&nbsp;<span class="caret"></span></button>
						<ul class="dropdown-menu">
								<li><a href="">Excel (.xls)</a></li>
								<li><a href="">Word (.doc)</a></li>
								<li><a href="">CSV (.csv)</a></li>
						</ul>
						<button class="btn btn-primary pull-right" onclick="javascript: print();"><span class="glyphicon glyphicon-print"></span>&nbsp;Print</button>
				</div>
		</div>




		<h2>Items</h2>
		<hr />

		<a href="@Url.Action("Create", "ItemsEF")" class="btn btn-primary" style="margin-bottom: 20px"><span class="glyphicon glyphicon-plus">&nbsp;</span>Create New</a>

		<div class="panel panel-primary">
				<div class="panel-heading">List of items</div>
				<div class="panel-body">
						<div ng-controller="FetchItemsController">

								<table class="table table-bordered table-hover table-responsive">
										<tr>
												<th>Name</th>
												<th>Unit</th>
												<th>Quantity</th>
										</tr>

										<tr ng-repeat="i in items">
												<td>{{i.Name}}</td>
												<td>{{i.Unit}}</td>
												<td>{{i.Quantity}}</td>
												<td>
														<a href="@Url.Action("Edit", "ItemsEF")/{{i.Item_id}}" class="btn btn-info"><span class="glyphicon glyphicon-edit">&nbsp;</span>Edit</a> |
														<a href="@Url.Action("Details", "ItemsEF")/{{i.Item_id}}" class="btn btn-primary"><span class="glyphicon glyphicon-tags">&nbsp;</span>Details</a> |
														<a href="@Url.Action("Delete", "ItemsEF")/{{i.Item_id}}" class="btn btn-danger"><span class="glyphicon glyphicon-trash">&nbsp;</span>Delete</a>
												</td>
										</tr>
								</table>
						</div>
				</div>
		</div>
</div>
<!-- ************** -->
<!-- Orders Template -->
<div ng-show="ordersVisible">

		<div style="margin-bottom: 70px; margin-top: 20px;">

				<div class="dropdown pull-right">
						<button class="btn btn-primary dropdown-toggle" data-toggle="dropdown" style="margin-right: 10px"><span class="glyphicon glyphicon-floppy-disk">&nbsp;</span>Export&nbsp;&nbsp;<span class="caret"></span></button>
						<ul class="dropdown-menu">
								<li><a href="">Excel (.xls)</a></li>
								<li><a href="">Word (.doc)</a></li>
								<li><a href="">CSV (.csv)</a></li>
						</ul>
						<button class="btn btn-primary pull-right" onclick="javascript: print();"><span class="glyphicon glyphicon-print"></span>&nbsp;Print</button>
				</div>
		</div>


		<h2>Orders</h2>
		<hr />


		<a href="@Url.Action("Create", "OrdersEF")" class="btn btn-primary" style="margin-bottom: 20px"><span class="glyphicon glyphicon-pencil">&nbsp;</span>Create New</a>


		<div class="panel panel-primary">
				<div class="panel-heading">List of orders</div>
				<div class="panel-body">
						<div ng-controller="FetchOrdersController">

								<table class="table table-bordered table-hover table-responsive">
										<tr>
												<th>Order Number</th>
												<th>Order Date</th>
												<th></th>
										</tr>
										<tr ng-repeat="o in orders">
												<td>{{o.Order_Date}}</td>
												<td>{{o.Customer}}</td>
												<td>
														<a href="@Url.Action("Edit", "OrdersEF")/{{o.Order_Number}}" class="btn btn-info"><span class="glyphicon glyphicon-edit">&nbsp;</span>Edit</a> |
														<a href="@Url.Action("Details", "OrdersEF")/{{o.Order_Number}}" class="btn btn-primary"><span class="glyphicon glyphicon-tags">&nbsp;</span>Details</a> |
														<a href="@Url.Action("Delete", "OrdersEF")/{{o.Order_Number}}" class="btn btn-danger"><span class="glyphicon glyphicon-trash">&nbsp;</span>Delete</a>
												</td>
										</tr>
								</table>
						</div>
				</div>
		</div>
</div>
<!-- **************  -->
